package com.bw.coll;

import com.bw.domain.Car;
import com.bw.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CollCar {

    @Autowired
    CarService car;

    @RequestMapping("/list")
    public List<Car> getList(String name,String carno){
        List<Car> cha = car.getCha(name, carno);
        return cha;
    }

    @RequestMapping("/tj")
    public int addTj(String name,String idcard,String tel,String carno,String cname,Integer tid,Integer status,String app){
        int i = car.addTj(name, idcard, tel, carno, cname, tid, status, app);
        return i;
    }

    @RequestMapping("/sc")
    public int deleSc(Integer id){
        int i = car.deleSc(id);
        return i;
    }

}
